<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="net.gz01.util.ZOHttp" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@include file="payutil.jsp" %>
<%@include file="md5.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>To Pay</title>
<script>
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
</script>
<style>
.tabPages{
margin-top:150px;text-align:center;display:block; border:3px solid #d9d9de; padding:30px; font-size:14px;
}
</style>
</head>
<body onLoad="document.uncome.submit()">
<div id="Content">
  <div class="tabPages">我们正在为您连接银行，请稍等......</div>
</div>
<%
    String AuthorizationURL = "/api/casherdesk"; //https://127.0.0.1:8033/api/casherdesk";
    String userName = "13911112222";
    String passWord = "88DF9004A4AB306337CC7F98248A76D1A57BA6151EF3261350CC4B50" ;
    String buyer="10005";
    String  seller    = "merStore10792";  //商家信息
    String     amount="1200";
    String payType = "1";
    String    mallOrderNo= generateOrderId();//20位订单号 时间戳+6位随机字符串组成
    String    goodNames="神奇挖掘机x2,高风挖掘机x3";//yyyy-MM-dd HH:mm:ss
    String returnUrl = "http://www.baidu.com";
    String notifyUrl = "http://127.0.0.1:8033/index";
    String time = System.currentTimeMillis()+"";

        String stringSignTemp="amount=" + amount +  "&buyer="+buyer+
                "&goodNames="+goodNames+
                "&mallOrderNo="+mallOrderNo+
                "&notifyUrl="+notifyUrl+
                "&passWord="+passWord+"&payType=" + payType +
                "&returnUrl="+returnUrl
                +"&seller="+seller+ "&timestamp=" + time +
                "&userName="+userName+"&version=V1.0"+
                "&1234567890abcdef1234567890abcdef";
        String pay_md5sign=md5(stringSignTemp);

//    JSONObject json = new JSONObject();
//    String res = ZOHttp.postJson(AuthorizationURL, json.toJSONString());
//
//    System.out.println(res);
%>
<!--
<iframe src="about:blank" id="kaixin" name="kaixin" align="center" width="960"  height="301" marginwidth="1" marginheight="1" frameborder="0" scrolling="no"> </iframe>
    <form name="uncome" action="<%=AuthorizationURL%>" method="post" target="kaixin">
 -->


<form name="uncome" action="<%=AuthorizationURL%>" method="post">
    <input type="text" name="userName"  value="<%=userName%>">
    <input type="text" name="passWord"  value="<%=passWord%>">
    <input type="hidden" name="buyer"  value="<%=buyer%>">
    <input type="hidden" name="seller"  value="<%=seller%>">
    <input type="hidden" name="amount"  value="<%=amount%>">
    <input type="hidden" name="payType"  value="<%=payType%>">
    <input type="hidden" name="mallOrderNo"  value="<%=mallOrderNo%>">
    <input type="hidden" name="goodNames"  value="<%=goodNames%>">
    <input type="hidden" name="returnUrl"  value="<%=returnUrl%>">
    <input type="hidden" name="notifyUrl"  value="<%=notifyUrl%>">
    <input type="hidden" name="version"  value="V1.0">
    <input type="hidden" name="timestamp"  value="<%=time%>">
    <input type="hidden" name="sign"  value="<%=pay_md5sign%>">
</form>

</body>
</html>
